package com.cloudkinto.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.cloudkinto.dto.stock.LeftQtyDto;
import com.cloudkinto.dto.stock.flowing.FlowingPageDto;
import com.cloudkinto.entity.ProductStockFlowingDo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 库存流水 Mapper 接口
 * </p>
 *
 * @author hua
 * @since 2024-11-28
 */
public interface ProductStockFlowingDao extends BaseMapper<ProductStockFlowingDo> {
    /**
     * 产品库存 -库存流水 -获取剩余库存
     */
    LeftQtyDto getProductClosedQty(String batchStr, String orderType, int type, String sku, int stockAttribute, Long whId, Long companyId, Long tenantId);

    IPage<FlowingPageDto> list(@Param("page") IPage<FlowingPageDto> page, @Param("map") Map<String, Object> map);

    List<FlowingPageDto> list(@Param("map") Map<String, Object> map);

    void insertBatch(@Param("list") List<ProductStockFlowingDo> list);
}
